# import requests
#
# import app
#
# response = requests.post(url=app.BASE_URL + "/api/sys/login",
#                          headers=app.HEADERS,
#                          json={"mobile": "13800000002", "password": "123456"})
# print("登陆的响应数据为: ", response.json())
# token = response.json().get("data")
# print("提取的token为: ", token)
# app.HEADERS["Authorization"] = "Bearer " + token
# print("令牌保存到全局变量请求头之后的结果为: ", app.HEADERS)
# response = requests.get(url=app.BASE_URL + "/api/sys/user?page=1&size=10",
#                         headers=app.HEADERS)
# print("查询员工列表的结果为: ", response.json())
# # 添加员工
# response = requests.post(url=app.BASE_URL + "/api/sys/user",
#                          headers=app.HEADERS,
#                          json={
#                              "username": "尼古拉斯赵四",
#                              "mobile": "13145208887",
#                              "workNumber": "2020",
#                              "timeOfEntry": "2020-01-01",
#                              "formOfEmployment": "1",
#                              "departmentId": "9527",
#                              "departmentName": "北京27期测试部",
#                              "correctionTime": "2020-12-04"
#                          })
# print("添加员工的结果为: ", response.json())
# app.EMP_ID = response.json().get("data").get("id")
# print("提取并保存到全局变量的员工ID为: ", app.EMP_ID)
# # 查询员工
# response = requests.get(url=app.BASE_URL + "/api/sys/user" + "/" + app.EMP_ID,
#                         headers=app.HEADERS)
# print("查询员工的URL为: ", response.url)
# print("查询员工的响应数据为: ", response.json())
# # 修改员工
# response = requests.put(url=app.BASE_URL + "/api/sys/user" + "/" + app.EMP_ID,
#                         headers=app.HEADERS,
#                         json={"username": "别哭,有的人"})
# print("修改员工的URL为: ", response.url)
# print("修改员工的结果为: ", response.json())
# # 删除员工
# response = requests.delete(url=app.BASE_URL + "/api/sys/user" + "/" + app.EMP_ID,
#                            headers=app.HEADERS)
# print("删除员工的URL为: ", response.url)
# print("删除后的结果为: ", response.json())
# 定义一个列表字典数据
a = [{"name": "毛宇"}, {"name": "姜欢欢"}, {"name": "周春燕"}]
# 开始转化
for i in a:
    print("还是字典：", i)

# 可以通过字典自带的方法itmes.values()来获取字典的value
for i in a:
    print("取出字典的所有value：", i.values())

# 把取出的数据，转化成元组
for i in a:
    print("把取出的字典数据，转化成元组：", tuple(i.values()))

# 把列表字典，转化成列表元组（这里只提取value）
empty_list = []  # 定义空列表，用于添加转化之后的元组数据
for i in a:
    # 把转换成元组的数据，按照循环次数添加到空列表中，从而做到转化成列表元素数据
    empty_list.append(tuple(i.values()))
    print("每次转化列表元组数据的过程：", empty_list)
